In order to improve the crowdsourced testing data sharing system in the cloud environment and solve the problems of data security and privacy protection in the field of crowdsourced testing, a Crowdsourced Testing Task Privacy Protection (CTTPP) scheme based on blockchain and CP-ABE (Ciphertext-Policy Attribute-Based Encryption) policy hiding was proposed. Blockchain technology and attribute based encryption were combined to improve the privacy of crowdsourced testing data sharing by the proposed scheme. Firstly, the terminal internal nodes were used to construct an access tree to express the access policy, and the exponentiation operation and bilinear pairing operation in CP-ABE were used to realize policy hiding, so as to improve the privacy protection ability of data sharing in the crowdsourced testing scenarios. Secondly, the blockchain smart contract was called to automatically verify the legitimacy of data visitors, and completed the verification of task ciphertext access rights together with the cloud server to further improve the security of crowdsourced testing tasks. The performance test results show that the average encryption and decryption time is shorter, and the calculation overhead of encryption and decryption is lower than the same type of access tree policy hiding algorithm. In addition, when the frequency of decryption requests reaches 1 000 transactions per second, the processing capacity of blockchain is saturated gradually, and the maximum processing delay for data uplinking and data querying is 0.80 s and 0.12 s, so the proposed scheme is suitable for lightweight commercial crowdsourced testing application scenarios.